/*
 *
func_yinyong3.cpp: In function ‘int& add(const int&, const int&)’:
func_yinyong3.cpp:7:16: warning: reference to local variable ‘tmp’ returned [-Wreturn-local-addr]
    7 |         return tmp;  //风险  函数结束对应内存空间回收
      |                ^~~
func_yinyong3.cpp:5:13: note: declared here
    5 |         int tmp  = 0;
      |             ^~~

代码执行后：
段错误 (核心已转储)

 */
#include <iostream>
using namespace std;
int& add(const int &a, const int &b)
{
	int tmp  = 0;
	tmp = a + b;
	return tmp;  //风险  函数结束对应内存空间回收
}
int main(void){
	int x = 100;
	int y = 200;
	int &t = add(x,y);
	t++;//通过别名操作 已经被系统回收的内存 
	cout << t <<endl;
	return 0;
}
